package haltica.com.mx.ape.domain;

import java.util.Collection;

import org.springframework.security.core.GrantedAuthority;
import org.springframework.security.core.userdetails.UserDetails;

public class UserDetailsImpl implements UserDetails {
	
	
	private static final long serialVersionUID = 1L;
	private String username;
	private String password;
	private Collection<GrantedAuthority> authorities;
	private boolean enabled;
	private boolean accountNonExpired;
	private boolean credentialsNonExpired;
	private boolean accountNonLocked;
	private UsuarioSistema details;
	
	
	/**
	 * 
	 */
	public UserDetailsImpl() {
	}

	/**
	 * @param username
	 * @param password
	 * @param authorities
	 * @param accountNonExpired
	 * @param credentialsNonExpired
	 * @param accountNonLocked
	 * @param enabled
	 * @param details
	 */
	public UserDetailsImpl(String username, String password,
			Collection<GrantedAuthority> authorities, boolean enabled,
			UsuarioSistema details) {
		
		this.username = username;
		this.password = password;
		this.authorities = authorities;
		this.enabled = enabled;
		this.details = details;
		
		this.accountNonExpired = true;
		this.credentialsNonExpired = true;
		this.accountNonLocked = true;
	}



	/**
	 * @return the username
	 */
	public String getUsername() {
		return username;
	}



	/**
	 * @return the password
	 */
	public String getPassword() {
		return password;
	}



	/**
	 * @return the authorities
	 */
	public Collection<GrantedAuthority> getAuthorities() {
		return authorities;
	}



	/**
	 * @return the accountNonExpired
	 */
	public boolean isAccountNonExpired() {
		return accountNonExpired;
	}



	/**
	 * @return the credentialsNonExpired
	 */
	public boolean isCredentialsNonExpired() {
		return credentialsNonExpired;
	}



	/**
	 * @return the accountNonLocked
	 */
	public boolean isAccountNonLocked() {
		return accountNonLocked;
	}



	@Override
	public boolean isEnabled() {
		return enabled;
	}



	/**
	 * @return the details
	 */
	public UsuarioSistema getDetails() {
		return details;
	}
	
}
